package com.woniuxy.microloanserver.service.impl;

import com.woniuxy.microloanserver.bean.LoanOrderBean;
import com.woniuxy.microloanserver.bean.LoanOrderStageBean;
import com.woniuxy.microloanserver.bean.LoanRepaymentBillBean;
import com.woniuxy.microloanserver.dao.LoanOrderDao;
import com.woniuxy.microloanserver.dao.LoanRepaymentBillDao;
import com.woniuxy.microloanserver.service.LoanOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Description: 贷款订单相关数据业务层接口实现类
 *
 * @Auther: HanLei
 * @Date: 2021/4/19:15:09
 */
@Service
public class LoanOrderServiceImpl implements LoanOrderService {

    //持久层接口实例
    @Resource
    LoanOrderDao loanOrderDao;
    @Resource
    LoanRepaymentBillDao billDao;


    @Override
    public boolean applyLoan(LoanOrderBean loanOrderBean,
                         LoanOrderStageBean loanOrderStageBean,
                         List<LoanRepaymentBillBean> bills) {

        boolean flag = true;
        //调用持久层接口方法
        loanOrderDao.addOrder(loanOrderBean);
        loanOrderDao.addOrderStage(loanOrderStageBean);
        billDao.addBills(bills);
        return flag;
    }
}
